import os
from celery import Celery
from celery_tasks import celeryconfig


os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
app = Celery()
app.config_from_object(celeryconfig)
app.autodiscover_tasks()  # 自动发现 django 里面被定义的任务
